﻿/**
 @CLEditor Insert Cut Plugin v1.0
 http://sne-news.googlecode.com
 requires CLEditor v1.2 or later
 
 Copyright 2011, Alexey Gubanov aka Ragnaar
 GPL Version 2 licenses.
*/
(function($) {
  // Define the icon button
  $.cleditor.buttons.cutx = {
    name: "cutx",
    image: "cut.gif",
    title: "Insert cut",
    command: "insertHtml",
	buttonClick: insertCut
  };
  
  // Add the button to the default controls
  $.cleditor.defaultOptions.controls = $.cleditor.defaultOptions.controls
    .replace(" source", " source | cutx");
	
	function insertCut(e, data){
		// Get the editor
		var editor = data.editor;
		var html = "<hr id=\"cut\">";
		
		editor.execCommand(data.command, html, null, data.button);
		editor.focus();
		
		return false;
  };
})(jQuery);